<template>
	<view>
		<view class="mainpadding pdl ffffff flexbetween">
			<view class="titletext bold hei_text">店家券名稱</view>
			<input class="main_size bold hei_text" type="text" placeholder="請輸入店家券名稱" style="text-align: right;">
		</view>
		<view class="mainpadding pdl ffffff flexbetween">
			<view class="hei_text bold titletext">票券類型</view>
			<u-radio-group v-model="type" placement="row" circle>
				<u-radio activeColor="#ff8505" :customStyle="{marginRight: '30rpx'}" label="套餐" name="1"></u-radio>
				<u-radio activeColor="#ff8505" label="折抵" name="2"></u-radio>
			</u-radio-group>
		</view>
		<view class="mainpadding pdl ffffff flexbetween">
			<view class="titletext bold hei_text">原價</view>
			<input class="main_size bold hei_text" type="text" placeholder="請輸入店家券原價" style="text-align: right;">
		</view>
		<view class="mainpadding pdl ffffff flexbetween">
			<view class="titletext bold hei_text">價格</view>
			<input class="main_size bold hei_text" type="text" placeholder="請輸入店家券價格" style="text-align: right;">
		</view>
		<view class="mainpadding pdl ffffff flexbetween">
			<view class="titletext bold hei_text">縮略圖</view>
			<view class="itemimgBox flexcenter">
				<image class="listleftimg radius" src="@/static/logo.png" mode=""></image>
			</view>
		</view>
		<view class="mainpadding pdl ffffff">
			<view class="titletext bold hei_text">主圖（0/1）</view>
			<view class="flexleft flex_wrap">
				<view class="itemimgBox flexcenter margin_top2" v-for="item in 2">
					<image class="listleftimg radius"
						src="@/static/logo.png"
						mode=""></image>
					<view class="deleteimg"></view>
				</view>
				<view class="itemimgBox flexcenter margin_top2">
					<image class="listleftimg radius" src="@/static/image/system/upimg.png" mode=""></image>
				</view>
			</view>
		</view>
		<view class="huang_text bold titletext mainpadding ffffff">領取時間</view>
		<view class="mainpadding2 ffffff flexbetween" @click="messageTime.timeShow=true;timevalue=2">
			<view class="hei_text bold titletext">開始</view>
			<view class="flexright">
				<input type="text" class="hei_text main_size bold margin_right1" style="text-align: right;" disabled=""
					v-model="get_starttime" placeholder="請選擇開始時間">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="mainpadding2 pdl ffffff flexbetween" @click="messageTime.timeShow=true;timevalue=3">
			<view class="hei_text bold titletext">結束</view>
			<view class="flexright">
				<input type="text" class="hei_text main_size bold margin_right1" style="text-align: right;" disabled=""
					v-model="get_endtime" placeholder="請選擇結束時間">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="huang_text bold titletext mainpadding ffffff">使用時間</view>
		<view class="mainpadding2 ffffff flexbetween" @click="messageTime.timeShow=true;timevalue=0">
			<view class="hei_text bold titletext">開始</view>
			<view class="flexright">
				<input type="text" class="hei_text main_size bold margin_right1" style="text-align: right;" disabled=""
					v-model="starttime" placeholder="請選擇開始時間">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="mainpadding2 pdl ffffff flexbetween" @click="messageTime.timeShow=true;timevalue=1">
			<view class="hei_text bold titletext">結束</view>
			<view class="flexright">
				<input type="text" class="hei_text main_size bold margin_right1" style="text-align: right;" disabled=""
					v-model="endtime" placeholder="請選擇結束時間">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="mainpadding pdl ffffff flexbetween" @click="selectrole()">
			<view class="hei_text bold titletext">可用分店</view>
			<view class="flexright">
				<input type="text" class="hei_text main_size bold margin_right1" style="text-align: right;"
					placeholder="請選擇可用分店">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="mainpadding pdl ffffff ">
			<view class="titletext bold hei_text">購買須知</view>
			<textarea placeholder="請輸入内容" maxlength="-1" class="main_size margin_top bold hei_text"
				style="height: 150rpx;width: 100%;" v-model="notice" />
		</view>
		<view class="mainpadding pdl ffffff ">
			<view class="titletext bold hei_text">使用須知</view>
			<textarea placeholder="請輸入内容" maxlength="-1" class="main_size margin_top bold hei_text"
				style="height: 150rpx;width: 100%;" v-model="buy_notice" />
		</view>
		<view class="mainpadding pdl ffffff ">
			<view class="flexbetween">
				<view class="titletext bold hei_text">詳情</view>
				<view class="addimg" @click="addSale"></view>
			</view>
			<view class="flexleft flex_wrap">
				<view class="itemimgBox flexcenter margin_top2" v-for="item in 1">
					<image class="listleftimg radius"
						src="@/static/logo.png"
						mode=""></image>
					<view class="deleteimg"></view>
				</view>
				<view class="itemimgBox flexcenter margin_top2">
					<image class="listleftimg radius" src="@/static/image/system/upimg.png" mode=""></image>
				</view>
			</view>
			<textarea placeholder="請輸入内容" maxlength="-1" class="main_size margin_top bold hei_text"
				style="height: 150rpx;width: 100%;" v-model="buy_notice" />
			<view class="flexleft flex_wrap">
				<view class="itemimgBox flexcenter margin_top2" v-for="item in 1">
					<image class="listleftimg radius"
						src="@/static/logo.png"
						mode=""></image>
					<view class="deleteimg"></view>
				</view>
				<view class="itemimgBox flexcenter margin_top2">
					<image class="listleftimg radius" src="@/static/image/system/upimg.png" mode=""></image>
				</view>
			</view>
			<textarea placeholder="請輸入内容" maxlength="-1" class="main_size margin_top bold hei_text"
				style="height: 150rpx;width: 100%;" v-model="buy_notice" />
		</view>
		<!-- <view class="flexbetween ffffff mainpadding_top">
			<view class="hei_text titletext bold">所在地區</view>
			<uni-data-picker @change="bindPickerChange" :localdata="items" v-model="address.county">
				<view class="flexright">
					<input class="hei_text main_size bold" type="text" style="text-align: right;"
						v-model="addressdetail" placeholder="請選擇所在地址">
					<u-icon name="arrow-right" color="#999" size="16"></u-icon>
				</view>
			</uni-data-picker>
		</view>
		<view class="flexbetween ffffff mainpadding_top">
			<view class="hei_text titletext bold">詳細地址</view>
			<view class="flexright">
				<input class="hei_text main_size bold" type="text" style="text-align: right;" disabled
					placeholder="請選擇詳細地址">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="mainpadding_top ffffff flexbetween">
			<view class="titletext bold hei_text">規格管理</view>
			<view class="flexright" @click="jumpurl('/pages/workbench/dianjiaqgg')">
				<input class="main_size bold hei_text" type="text" placeholder="請編輯" disabled="" v-model="time"
					style="text-align: right;">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view>
		<view class="mainpadding_top ffffff flexbetween">
			<view class="titletext bold hei_text">關聯商品</view>
			<view class="flexright" @click="jumpurl('/pages/workbench/guanliansp?type=3')">
				<input class="main_size bold hei_text" type="text" placeholder="請選擇關聯商品" disabled="" v-model="time"
					style="text-align: right;">
				<u-icon name="arrow-right" color="#999" size="16"></u-icon>
			</view>
		</view> -->
		<view class="mainpadding">
			<view class="submitbtn">確認</view>
		</view>
		<timePicker :messageTime="messageTime" @timeConfirm="timeConfirm"></timePicker>
	</view>
</template>

<script>
	import citys from "../../static/city/city.js"
	export default {
		data() {
			return {
				messageTime: {
					timeShow: false,
					title: "開始時間",
					mode: "date"
				},
				addressdetail: "", //详細地址
				address: {
					province: "", //省
					city: "", //市
					county: "", //區
				},
			}
		},
		methods: {
			timeConfirm(e) {
				this.time = e
			},
			bindPickerChange(val) {
				let area = val.detail.value
				let areas = [area[0].text, area[1].text, area[2].text];
				this.addressdetail = JSON.parse(JSON.stringify(areas.join("/")));
				this.address.province = area[0].value;
				this.address.city = area[1].value;
				this.address.county = area[2].value;
			},
			jumpurl(url) {
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
::v-deep.u-radio-group {
		flex: none !important;
	}
</style>